﻿@using WSCeCommerce.Domain;
@using WSCeCommerceWeb.Helpers;
@using WSCeCommerceWeb;



<script src="~/Scripts/jquery-1.8.2.min.js"></script>
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>

@{
    string textValue = ViewBag.SearchCriteria == null? "":ViewBag.SearchCriteria.Text;
    int categoryValue = ViewBag.SearchCriteria == null ? ListHelper.SEARCH_ALL_CATEGORIES : ViewBag.SearchCriteria.Category;
} 
       
@using (Html.BeginForm("Search","Item")) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Search</legend>
        <div>
            <span class="editor-label">
                Search
            </span>
            <span class="editor-field">
               <input type="text" name="Text" id="Text" value="@textValue" /> 
            </span>
      
           <span class="editor-field">
               @Html.DropDownList("Category",ListHelper.GetCategories(true, categoryValue))
              </span>
           <input type="submit" value="Search" id="searchtext"/>
        </div>
    </fieldset>
}
